package com.example.spring.bean2;

import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

/**
 * ClassName:A
 * Package:com.example.spring.bean2
 * Description:
 *
 * @Author:ZhangXin
 * @Create:2023/5/9-21:47
 * @Version:v1.0
 */
//选择性实例化bean
@Component
public class A {
    public A() {
        System.out.println("A的无参构造执行");
    }
}

@Controller
class B {
    public B() {
        System.out.println("B的无参构造执行");
    }
}
@Service
class C {
    public C() {
        System.out.println("C的无参构造执行");
    }
}
@Repository
class D {
    public D() {
        System.out.println("D的无参构造执行");
    }
}
@Controller
class E {
    public E() {
        System.out.println("E的无参构造执行");
    }
}

